package section2;


import section2.sparsematmult.*; 
import jgfutil.*; 

public class SparseTest{ 

  public static int nthreads;

  public static void main(String argv[]){

	nthreads = Integer.parseInt(argv[0]);
	int size = Integer.parseInt(argv[1]);
	System.out.println();
	System.out.print(nthreads+" "+size+" ");

    	JGFSparseMatmultBench smm = new JGFSparseMatmultBench(nthreads); 
    	double res1 = smm.getResult(size);
    	JGFSparseMatmultOCLBench smm2 = new JGFSparseMatmultOCLBench(nthreads); 
    	double res2 = smm2.getResult(size);

	double dev = Math.abs(res1 - res2);
	if(dev > 1.0e-5)
	{
		System.out.println("Results not equal.");
		System.out.println("Original result: "+res1+", ocl result: "+res2);
	}
  }
}

